import { S } from '../../s';
import { PSControlContainerImpl } from '../pscontrol-container-impl';
import { IPSAppTitleBar } from './ipsapp-title-bar';
import { IPSLanguageRes } from '../../res/ipslanguage-res';
import { IPSSysImage } from '../../res/ipssys-image';

export class PSAppTitleBarImpl
  extends PSControlContainerImpl
  implements IPSAppTitleBar
{
  protected cappslanguageres: IPSLanguageRes;
  getCapPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.cappslanguageres ||
      (this.cappslanguageres = this.fillObjectModel(
        S._276,
        this.M.getCapPSLanguageRes,
        S._2a8,
      ) as IPSLanguageRes)
    );
  }

  get caption(): string {
    return this.M.caption;
  }

  protected pssysimage: IPSSysImage;
  getPSSysImage(): IPSSysImage | null {
    return (
      this.pssysimage ||
      (this.pssysimage = this.fillObjectModel(
        S._27b,
        this.M.getPSSysImage,
        S._2ad,
      ) as IPSSysImage)
    );
  }

  get titleBarStyle(): 'USER' | 'USER2' {
    return this.M.titleBarStyle;
  }

  get titleBarType(): string {
    return this.M.titleBarType;
  }
  get cls(): string {
    return 'PSAppTitleBarImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._25e) return true;
    return super.instanceof(cls);
  }
}
